<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);"
		action="${pageContext.request.contextPath}/product/product/list"
		method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField"
			value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection"
			value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>商品类型名称：<input type="text" name="product_type_name"
						value="${requestScope.dwzPageBean.countResultMap.product_type_name}"
						placeholder="输入商品类型名称" /></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		<shiro:hasPermission name="/product/product/toInsert">
			<li><a class="add"
				href="${pageContext.request.contextPath}/product/product/toInsert"
				rel="insert" target="dialog" mask="true"><span>添加</span></a></li>
				</shiro:hasPermission>
				<shiro:hasPermission name="/product/product/delete">
			<li><a class="delete"
				href="${pageContext.request.contextPath}/product/product/delete"
				rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录"
				mask="true"><span>批量删除</span></a></li>
				</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc"
		width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="merchantProductTypeId"
					class="checkboxCtrl"></th>
				<th orderField="productTypeName"
					<c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'product_type_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>商品类型名称</th>
				<th orderField="sorting"
					<c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sorting'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>排序</th>
				<th orderField="add_time"
					<c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'add_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>添加时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>

			<c:if
				test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record"
					items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr  ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/product/product/toUpdate?merchantProductTypeId=${record.merchantProductTypeId}" title="编辑">
						<td>
						<c:if test="${record.del!=3}">
						<input name="merchantProductTypeId" value="${record.merchantProductTypeId}"
							type="checkbox">
							</c:if></td>
						<td>${record.productTypeName}</td>
						<td>${record.sorting}</td>
						<td><fmt:formatDate value="${record.addTime}" pattern="yyyy-MM-dd" /></td>

						<td>
						<a title="编辑" target="dialog"
							href="${pageContext.request.contextPath}/product/product/toUpdate?id=${record.merchantProductTypeId}"
							class="editBtn" mask="true"><span>编辑</span>
							</a> 
							<c:if test="${record.del!=3}">
							<a
							title="确定要删除吗？" mask="true" target="ajaxTodo"
							href="${pageContext.request.contextPath}/product/product/delete?id=${record.merchantProductTypeId}"
							class="deleteBtn" mask="true"><span>删除</span>
							</a>
							</c:if>
						</td>

					</tr>
				</c:forEach>
			</c:if>

		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>